import {checkRoleNav} from "@/api/public";

export default {
    state: {
       menu:[]
    },
    getters: {
        getMenu(state){
            return state.menu;
        }
    },
    mutations: {
        setMenu(state,data){
            state.menu = data;
        }
    },
    actions: {
        async fetchMenu({commit}){
            const {data} = await checkRoleNav();
            data && commit('setMenu',data);
        }
    },

}
